aboutsummaryrefslogtreecommitdiff
path: root/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.tes...
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-12-02 21:24:23 +0000
committerMichael Williamson <mike@zwobble.org>2023-12-02 21:26:19 +0000
commit41fcbdb71e6603919f0b751998452a45b8d9a0a3 (patch)
tree81bc8abd48f21655780f58cd395b2eb783322540 /snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
parent496e7f4addb7866fb1e419a98c52a870393296f4 (diff)
Support effects in effect handler methods
Diffstat (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected')
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected65
1 files changed, 65 insertions, 0 deletions
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
new file mode 100644
index 00000000..e3e8d86f
--- /dev/null
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -0,0 +1,65 @@
+Compilation unit elements:
+
+(
+ function-decl
+ "shed__runtime__effects_get_handler"
+ params=()
+ return-type=data-ptr
+)
+(
+ function-decl
+ "shed__runtime__effects_set_handler"
+ params=((param "effectHandler" data-ptr))
+ return-type=void
+)
+(
+ function
+ "shed__effectHandlerMethod__f__0"
+ visibility=private
+ locals=((param "effectHandlerMethodPointer__0" data-ptr) (val "effectHandler__0" data-ptr) (val "effectHandler__1" data-ptr) (val "tmp__0" int))
+ return-type=int
+ body=(
+ (call (local "effectHandler__0") "shed__runtime__effects_get_handler" ())
+ (
+ memory-load
+ (local "effectHandler__1")
+ pointer=(local "effectHandlerMethodPointer__0")
+ layout=(struct (function-ptr data-ptr (struct ())))
+ offset=(1)
+ )
+ (call _ "shed__runtime__effects_set_handler" ((local "effectHandler__1")))
+ (local-store (local "tmp__0") (int 0))
+ (call _ "shed__runtime__effects_set_handler" ((local "effectHandler__0")))
+ (resume (local "tmp__0"))
+ )
+)
+
+Locals:
+ * (val "closure__f__0" int)
+ * (val "effectHandlerMethodPointer__f__0" data-ptr)
+ * (val "effectHandlerCurrent__0" data-ptr)
+
+Instructions:
+
+(
+ (alloc-heap (local "effectHandlerMethodPointer__f__0") (struct (function-ptr data-ptr (struct ()))))
+ (
+ memory-store
+ pointer=(local "effectHandlerMethodPointer__f__0")
+ layout=(struct (function-ptr data-ptr (struct ())))
+ offset=(0)
+ value=(function-ptr "shed__effectHandlerMethod__f__0")
+ )
+ (call (local "effectHandlerCurrent__0") "shed__runtime__effects_get_handler" ())
+ (
+ memory-store
+ pointer=(local "effectHandlerMethodPointer__f__0")
+ layout=(struct (function-ptr data-ptr (struct ())))
+ offset=(1)
+ value=(local "effectHandlerCurrent__0")
+ )
+ (data-ptr-to-int (local "closure__f__0") (local "effectHandlerMethodPointer__f__0"))
+)
+
+Temporary stack:
+ * closure__f__0